package complexes;

public class Angle
{
	private double theta; // Angle en radians (dans [0, 2pi[)
	
	public Angle(double angleEnRadians)
	{
		theta = angleEnRadians - 2 * Math.PI * Math.floor(angleEnRadians / (2* Math.PI));
	}
	
	public double getAngle()
	{
		return theta;
	}
	
	public Angle somme(Angle a)
	{
		return new Angle(a.getAngle() + this.getAngle());
	}
	
	public Angle facteur(double k)
	{
		return new Angle(k * this.getAngle());
	}
	
	public boolean equals(Object o)
	{
		if(!(o instanceof Angle))
			return false;
		else
			return theta == ((Angle)o).getAngle();
	}
	
	public String toString()
	{
		return ""+theta;
	}
}
